
include_directories(
${MELEON_DIR}
${SDK_DIR}
${SDK_DIR}/glm/glm
${SDK_DIR}/Vulkan-Headers/include
)

add_definitions(
-D FG_CACHE_LINE=std::hardware_destructive_interference_size
-D FG_ENABLE_VULKAN_MEMORY_ALLOCATOR
-D FG_STD_VARIANT
-D FG_STD_OPTIONAL
-D FG_ENABLE_GLFW
-D FG_STD_FILESYSTEM
-D FG_STD_STRINGVIEW
)
set(FG_ENABLE_GLFW TRUE)

set(SourceFile 
"Tools/GSLibraryLoad.h"
"Interface/IWindow.h"
"Window/WindowGLFW.h"
"Window/WindowGLFW.cpp"

# "planet/GenPlanetApp.h"
# "planet/GenPlanetApp.cpp"
# "planet/SphericalCube.h"
# "planet/SphericalCube.cpp"
# "planet/SphericalCubeMath.h"
# "planet/UnitTest_SphericalCubeMath.cpp"

# "planet/shaders/planet.glsl"
# "planet/shaders/gen_height.glsl"

"Main/GSTest.cpp"
"Main/GSApp.h"
"Main/GSApp.cpp"
)

if (${FG_ENABLE_GLFW})
link_directories(${SDK_DIR}/glfw/lib/)
endif()

add_executable(GSTest  ${SourceFile})

source_group("Tools" FILES "Tools/GSLibraryLoad.h")

source_group("Interface" FILES 
"Interface/IWindow.h"
)

source_group("Main" FILES 
"Main/GSTest.cpp"
"Main/GSApp.h"
"Main/GSApp.cpp"
)
source_group("Window" FILES 
"Window/WindowGLFW.h"
"Window/WindowGLFW.cpp"
)

# source_group("planet" FILES
# "planet/GenPlanetApp.h"
# "planet/GenPlanetApp.cpp"
# "planet/SphericalCube.h"
# "planet/SphericalCube.cpp"
# "planet/SphericalCubeMath.h"
# "planet/UnitTest_SphericalCubeMath.cpp"
# )

# source_group("planet\\shaders" FILES
# "planet/shaders/planet.glsl"
# "planet/shaders/gen_height.glsl"
# )

target_include_directories( "GSTest" PUBLIC ".." )
target_include_directories( "GSTest" PUBLIC "." )



if (${FG_ENABLE_GLFW})
	target_link_libraries( "GSTest" "glfw3" )
endif()
if (${FG_ENABLE_SFML})
	target_link_libraries( "GSTest" "sfml-window" )
endif()
if (${FG_ENABLE_SDL2})
	target_link_libraries( "GSTest" "SDL2-static" )
endif()

if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
	target_link_libraries("GSTest" 
		"GSStl_d"
		"GSScene"
	)
elseif(${CMAKE_BUILD_TYPE} STREQUAL "Release")
	target_link_libraries("GSTest" 
		"GSStl"
		"GSScene"
	)
endif()

# compiler
target_compile_definitions( "GSTest" PRIVATE $<$<CONFIG:Debug>: ${PROJECTS_SHARED_DEFINES_DEBUG}> )
target_compile_definitions( "GSTest" PRIVATE $<$<CONFIG:Profile>: ${PROJECTS_SHARED_DEFINES_PROFILE}> )
target_compile_options( "GSTest" PRIVATE $<$<CONFIG:Release>: ${PROJECTS_SHARED_CXX_FLAGS_RELEASE}> )
target_compile_options( "GSTest" PRIVATE $<$<CONFIG:Profile>: ${PROJECTS_SHARED_CXX_FLAGS_PROFILE}> )
target_compile_options( "GSTest" PRIVATE $<$<CONFIG:Debug>: ${PROJECTS_SHARED_CXX_FLAGS_DEBUG}> )
target_compile_definitions( "GSTest" PRIVATE $<$<CONFIG:Release>: ${PROJECTS_SHARED_DEFINES_RELEASE}> )
target_compile_definitions( "GSTest" PUBLIC "FG_TEST_DUMPS_DIR=\"${PROJECT_SOURCE_DIR}/Generate/Dumps\"" )
#target_compile_definitions( "GSTest" PUBLIC "FG_DATA_PATH=R\"(${CMAKE_CURRENT_SOURCE_DIR}/planet/)\"" )

if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
    set_property(TARGET "GSTest"  PROPERTY DEBUG_POSTFIX _d)
endif()